<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title><PHP>echo getSysTitle();</PHP></title>
<script src="__JS__/jquery-1.7.1.min.js"></script>
<script src="__JS__/jquery.form.js"></script>
<link rel="stylesheet" href="__JS__/validfrom/css/style.css" type="text/css" media="all" />
<link href="__JS__/validfrom/css/demo.css" type="text/css" rel="stylesheet" />
<link href="__JS__/validfrom/plugin/jqtransform/jqtransform.css" type="text/css" rel="stylesheet" />
<script type="text/javascript" src="__JS__/validfrom/js/Validform_v5.2_min.js"></script>
<script type="text/javascript" src="__JS__/validfrom/plugin/jqtransform/jquery.jqtransform-min.js"></script>
<script type="text/javascript" src="__JS__/uploadify/jquery.uploadify.min.js"></script>
<link rel="stylesheet" href="__JS__/uploadify/uploadify.css" type="text/css" media="all" />

<script src="__JS__/wdatepicker/WdatePicker.js" type="text/javascript" ></script>
<style type="text/css">
body{background-color:#FFF}
.inputYes{color:#FF0000}
</style>
<script>
$(document).ready(function(){
	//屏蔽退格键 使整个页面后退
	$(document).keydown(function (e) {  
        var doPrevent; 
        if (e.keyCode == 8) {  
            var d = e.srcElement || e.target;  
            if (d.tagName.toUpperCase() == 'INPUT' || d.tagName.toUpperCase() == 'TEXTAREA') {  
                doPrevent = d.readOnly || d.disabled;  
           }  
            else  
                doPrevent = true;  
        }  
        else  
            doPrevent = false;  
        if (doPrevent){  
            e.preventDefault();  
        }else{
        	e.keyCode=0;
        	e.returnValue=false;
        }
    });  

});
function showAlert(type,id){
	if(type=="y"){
		type='1'; 
		 info="确认完成成功";
		 url="?g=Home&m=Order&a=detail&O_ID="+id;
	}else{
		type='2'; 
		 info="确认完成失败";
		 url="?g=Home&m=Order&a=detail&O_ID="+id;
	}
	 parent.window.location.href="?g=Home&m=Index&a=info&type="+type+"&info="+encodeURI(info)+"&url="+encodeURIComponent(url);
}
</script>
</head>
<body>
<div  style="padding-top:15px;">
<form action="?g=Home&m=Order&a=savefh" method="post" id="roleForm" class="registerform"  enctype="multipart/form-data" >
<fieldset>
	<table border="0" cellspacing="0" cellpadding="0">
		<tr>
			
            <td style=""><span class="inputYes">*</span>安装卡：</td>
            <td style="">
            <input style=""  type="text" value="" id="txtFileName" disabled="disabled" autocomplete="off" class="inputxt"  plugin="swfupload" />
	           	<span id="spanButtonPlaceholder" ></span>
	            <input id="file_upload" name="file_upload" type="file" multiple="true">
             </td>
            <td><div class="Validform_checktip" id="azk_show">扫描或拍摄，{$extName}格式，500K以内</div></td>
		</tr>
		<tr>
			
            
            <td style=""><span class="inputYes">*</span>产品条码：</td>
            <td style="width:180px;"><input type="text" id="P_BAR_CODE" value="" name="data[P_BAR_CODE]" class="inputxt" datatype="*"  /></td>
            <td><div class="Validform_checktip" id="cp_show">请输入产品上的条码</div></td>
		</tr>
		<tr>
			
           
            <td style="">安装时间：</td>
            <td style="">
            <table>
            <tr>
            <td><input style="padding:4px 2px"  type="text" id="O_SRV_TIME" name="data[O_SRV_TIME]" value="" readonly></td>
            <td><img onclick="WdatePicker({el:'O_SRV_TIME',dateFmt:'yyyy-MM-dd HH:mm'})" src="__JS__/wdatepicker/skin/datePicker.gif" width="20" height="30" align="absmiddle"></td>
            </tr>
            </table>
            
			
           </td>
            <td><div class="Validform_checktip">请选择安装完成时间</div></td>
		</tr>
		<tr>
			
           
            <td style="">备注</td>
            <td style=""><textarea rows="3" cols="60" id="O_ST_MEMO" name="data[O_ST_MEMO]"></textarea></td>
            <td><div class="Validform_checktip">其他说明(200字以内)</div></td>
		</tr>
		<tr>
			<td colspan="3" style="text-align:center">
					<input type="hidden" name="o_id" value="{$o_id}">
					<input type="hidden" name="op" value="1">
    				<input style="width:60px;height:30px;text-align:center;padding:2px 4px;" type="submit" value="确认提交" />
			</td>
		</tr>
	</table>
</fieldset>
</form>
</div>
</body>
<script>
$(document).ready(function(){
	
	$('#file_upload').uploadify({
		'formData'     : {
			'timestamp' : '{$timestamp}',
			'token'     : '{$timestampMd5}'
		},
		'swf'      : '__JS__/uploadify/uploadify.swf',
		'uploader' : '?g=Home&m=Order&a=upload&o_id={$o_id}'
	});
	$.extend({
		handleError: function( s, xhr, status, e ) {
			// If a local callback was specified, fire it
			if ( s.error ) {
				s.error.call( s.context || s, xhr, status, e );
			}

			// Fire the global callback
			if ( s.global ) {
				(s.context ? jQuery(s.context) : jQuery.event).trigger( "ajaxError", [xhr, s, e] );
			}
		},
	});
	$(".registerform").Validform({
		usePlugin:{
			/*swfupload:{
				file_post_name: "resume_file",
				upload_url: "?g=Home&m=Order&a=upload&o_id={$o_id}",
				button_image_url: "__JS__/validfrom/plugin/swfupload/XPButtonUploadText_61x22.png",
				//button_image_url: "__PUBLIC__/images/home/upload-3.png",
				flash_url: "__JS__/validfrom/plugin/swfupload/swfupload.swf",
				file_size_limit:"{$filesize}",
				file_types:"{$extName}"
			},
			*/
			jqtransform:{}
		},
		
		tiptype:function(msg,o,cssctl){
			if(!o.obj.is("form")){
				var objtip=o.obj.parents("td").next().find(".Validform_checktip");
				cssctl(objtip,o.type);
				objtip.text(msg);
			}

		}/*,
		usePlugin:{
			jqtransform:{}
		}*/
	});
	
	$('#roleForm').submit(function(){
		$(this).ajaxSubmit(options); 
		return false;
	});
	//$('#roleForm').ajaxSubmit(options); 
	var options={
			 beforeSubmit:  showRequest,  
			 success:       showResponse  
	};
});
function showRequest(formData, jqForm, options) { 
	if($("#hidFileID").val()==''){
		//<img src='__JS__/validfrom/images/error.png' align='absmiddle'/>
		$("#azk_show").html("<font color='red'>请上传安装卡；{$extName}格式，500K以内</font>");
		return false;
	}else{
		if($("#hidFileID").val()=="size"){
			$("#azk_show").html("<font color='red'>文件太大；大小在500K以内</font>");
			return false;
		}if($("#hidFileID").val()=="name"){
			$("#azk_show").html("<font color='red'>文件重复</font>");
			return false;
		}
		else{
			$("#azk_show").html("<font color='#AFEA0E'>检测成功</font>");
			
		}
		
	}
	
	if($("#P_BAR_CODE").val()==''){
		$("#cp_show").html("<font color='red'>请输入产品上的条码</font>");
		return false;
	}else{
		$("#cp_show").html("<font color='#AFEA0E'>检测成功</font>");
		
	}
	
	
	return true;
	
}
function showResponse(rs, statusText, xhr, $form)  { 
	//alert(rs);
}
</script>
</html>